﻿Imports System.Data.SqlClient

Public Class cn_second_right
    Inherits System.Web.UI.UserControl
    Private objrd As SqlDataReader = Nothing
    Private objfind As New GetData
    Private sSQL As String
    Private ps As New PreparedStatement(sSQL)
    Private userId As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Session("uid") <> Nothing And Session("uid") <> "") Then
            Dim sSQL As String
            Dim strErr As String = ""

            sSQL = "select * from member_info where member_id = @userId and lang_flag = 'zh'"
            ps.addParameter("userId", Session("uid"))
            ps.strSql = sSQL
            Dim conn As SqlConnection = objfind.getConn()

            objrd = objfind.dr(ps, strErr, conn, objrd)
            If (objrd.Read()) Then
                loginul.InnerHtml = "<div style=""margin-bottom:3px;padding-left:15px;""><span style=""color:#F9F;"">欢迎 </span> &nbsp;&nbsp;" & objrd.Item("member_name") & "</div> <div style=""margin-bottom:5px;padding-left:15px;""><a href=""/chinese/members/members-home.aspx"" style=""text-decoration:none;"">进入会员中心</a></div>"
            Else
                loginul.InnerHtml = "<div style=""margin-bottom:3px; padding-left:15px;""><span style=""color:#F9F;""></span> &nbsp;&nbsp;无中文名</div> <div style=""margin-bottom:5px;padding-left:15px;""><a href=""/chinese/members/members-home.aspx"" style=""text-decoration:none;"">进入会员中心</a></div>"
            End If
            objfind.closeConn(conn)

        End If
    End Sub

End Class